﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<skags.Models.Child>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Börnin mín
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<div id="navigation">
<% Html.RenderPartial("IndexNavigation"); %>
</div>
<div id="content">

    <h2>Börnin mín</h2>
    <p>Hér getur þú eytt og breytt upplýsingum um börnin þín</p>
    
      <table>
        <tr>
            <td><a href="/Profile/CreateChild"><img src="../../Content/icons/create.png" alt="Skrá barn" /></a></td>
            <th>
                Barn
            </th>
             <th>
                Kyn
            </th>
             <th>
                Fæðingardagur
            </th>
            <th>
                Lýsing
            </th>
        </tr>

    <% foreach (var item in Model) {%>
    
        <tr>
            <td>
                <a href="DeleteChild/<%= item.ID %>" onclick="return confirm('Ertu viss um að þú viljir eyða þessu barni?')"><img src="../../Content/icons/delete.png" alt="Eyða" /></a>
                &nbsp;
                <a href="/Profile/EditChild/<%= item.ID %>"><img src="../../Content/icons/edit.png" alt="Breyta" /></a>
            </td>
            <td>
                <%: item.Name %>
            </td>
            <td>
                <% if (item.Sex) {%> kk <%} else { %> kvk <% }%>
            </td>
            <td>
                <%: (item.BirthDate).ToShortDateString()%>
            </td>
             <td>
                <%: item.Description %>
            </td>
        </tr>
    
    <% } %>

    </table>
    </div>

</asp:Content>
